package com.huike.web.controller.report;

import com.huike.business.service.ITbBusinessService;
import com.huike.clues.service.ITbClueService;
import com.huike.common.core.domain.AjaxResult;
import com.huike.contract.service.ITbContractService;
import com.huike.report.service.IReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.huike.common.core.controller.BaseController;

import java.util.Date;


@RestController
@RequestMapping("/report")
public class ReportController extends BaseController {
    @Autowired
    ITbClueService iTbClueService;
    @Autowired
    IReportService iReportService;
    @Autowired
    ITbBusinessService iBusinessService;
    @Autowired
    ITbContractService iTbContractService;


    @GetMapping("getVulnerabilityMap/{beginCreateTime}/{endCreateTime}")
    public AjaxResult getVulnerabilityMap(@PathVariable Date beginCreateTime, @PathVariable Date endCreateTime) {
        int cluesNums = iTbClueService.selectVulnerabilityMap(beginCreateTime, endCreateTime);
        int effectiveCluesNums = iTbClueService.selectVulnerabilityMap1(beginCreateTime, endCreateTime);
        int businessNums = iBusinessService.selectTbBusinesslist(beginCreateTime, endCreateTime);
        int contractNums=iTbContractService.selectTbContractlist(beginCreateTime, endCreateTime);
        AjaxResult data = new AjaxResult();
        data.put("cluesNums", cluesNums);
        data.put("effectiveCluesNums", effectiveCluesNums);
        data.put("businessNums", businessNums);
        data.put("contractNums", contractNums);
        return AjaxResult.success("查询成功", data);
    }

}